<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>helloworld</title>
		<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
		<link href="//cdn.bootcss.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet">
	</head>

	<body>
		<div class="myscroll"></div>
		<script type="text/javascript">
			var opt = {
					"position": "fixed",
					"bottom": "10px",
					"right": "50px",
					"z-index": "1030",
					"cursor": "pointer",
					"display": "block"
				};
			//定义插件  显示图标
			$.fn.myPlugin = function() {
				this.css(opt).attr('title', '回到顶部').html('<i class="fa fa-angle-double-up fa-3x"></i>')
			}

			$(function() {
				$(".myscroll").myPlugin();
			})
		</script>
	</body>

</html>